import { OccType } from "core/typeDefine/typeDefine"
import { EquipmentsModel, PackagesModel } from "./equipmentsModel"
import { EquipmentsGemModel, EquipmentsLvlupModel } from "./partnerModel"

export class TeamEquipmentListModel {
    [OccType.Warrior]: EquipmentsModel[]
    [OccType.MainTank]: EquipmentsModel[]
    [OccType.Wizard]: EquipmentsModel[]
    [OccType.Archer]: EquipmentsModel[]
    [OccType.Assassin]: EquipmentsModel[]
    [OccType.Assistant]: EquipmentsModel[]
    constructor(opts: any = {}) {
        this[OccType.Warrior] = opts[OccType.Warrior] || []
        this[OccType.MainTank] = opts[OccType.MainTank] || []
        this[OccType.Wizard] = opts[OccType.Wizard] || []
        this[OccType.Archer] = opts[OccType.Archer] || []
        this[OccType.Assassin] = opts[OccType.Assassin] || []
        this[OccType.Assistant] = opts[OccType.Assistant] || []
        for (let i = 0; i < 3; i++) {
            this[OccType.Warrior][i] = new EquipmentsModel(this[OccType.Warrior][i])
            this[OccType.MainTank][i] = new EquipmentsModel(this[OccType.MainTank][i])
            this[OccType.Wizard][i] = new EquipmentsModel(this[OccType.Wizard][i])
            this[OccType.Archer][i] = new EquipmentsModel(this[OccType.Archer][i])
            this[OccType.Assassin][i] = new EquipmentsModel(this[OccType.Assassin][i])
            this[OccType.Assistant][i] = new EquipmentsModel(this[OccType.Assistant][i])
        }
    }
}
export class TeamPackageListModel {
    [OccType.Warrior]: PackagesModel[]
    [OccType.MainTank]: PackagesModel[]
    [OccType.Wizard]: PackagesModel[]
    [OccType.Archer]: PackagesModel[]
    [OccType.Assassin]: PackagesModel[]
    [OccType.Assistant]: PackagesModel[]
    constructor(opts: any = {}) {
        this[OccType.Warrior] = opts[OccType.Warrior] || []
        this[OccType.MainTank] = opts[OccType.MainTank] || []
        this[OccType.Wizard] = opts[OccType.Wizard] || []
        this[OccType.Archer] = opts[OccType.Archer] || []
        this[OccType.Assassin] = opts[OccType.Assassin] || []
        this[OccType.Assistant] = opts[OccType.Assistant] || []
        for (let i = 0; i < 3; i++) {
            this[OccType.Warrior][i] = new PackagesModel(this[OccType.Warrior][i])
            this[OccType.MainTank][i] = new PackagesModel(this[OccType.MainTank][i])
            this[OccType.Wizard][i] = new PackagesModel(this[OccType.Wizard][i])
            this[OccType.Archer][i] = new PackagesModel(this[OccType.Archer][i])
            this[OccType.Assassin][i] = new PackagesModel(this[OccType.Assassin][i])
            this[OccType.Assistant][i] = new PackagesModel(this[OccType.Assistant][i])
        }
    }
}
export class TeamPackageActiveModel {
    [OccType.Warrior]: number
    [OccType.MainTank]: number
    [OccType.Wizard]: number
    [OccType.Archer]: number
    [OccType.Assassin]: number
    [OccType.Assistant]: number
    constructor(opts: any = {}) {
        this[OccType.Warrior] = opts[OccType.Warrior] || 0
        this[OccType.MainTank] = opts[OccType.MainTank] || 0
        this[OccType.Wizard] = opts[OccType.Wizard] || 0
        this[OccType.Archer] = opts[OccType.Archer] || 0
        this[OccType.Assassin] = opts[OccType.Assassin] || 0
        this[OccType.Assistant] = opts[OccType.Assistant] || 0
        }
    }


export class EquipmentsStrListModel {
    [OccType.Warrior]: EquipmentsLvlupModel
    [OccType.MainTank]: EquipmentsLvlupModel
    [OccType.Wizard]: EquipmentsLvlupModel
    [OccType.Archer]: EquipmentsLvlupModel
    [OccType.Assassin]: EquipmentsLvlupModel
    [OccType.Assistant]: EquipmentsLvlupModel
    constructor(opts: any = {}) {
        this[OccType.Warrior] = new EquipmentsLvlupModel(opts[OccType.Warrior])
        this[OccType.MainTank] = new EquipmentsLvlupModel(opts[OccType.MainTank])
        this[OccType.Wizard] = new EquipmentsLvlupModel(opts[OccType.Wizard])
        this[OccType.Archer] = new EquipmentsLvlupModel(opts[OccType.Archer])
        this[OccType.Assassin] = new EquipmentsLvlupModel(opts[OccType.Assassin])
        this[OccType.Assistant] = new EquipmentsLvlupModel(opts[OccType.Assistant])
    }
}

export class EquipmentsGemListModel {
    [OccType.Warrior]: EquipmentsGemModel
    [OccType.MainTank]: EquipmentsGemModel
    [OccType.Wizard]: EquipmentsGemModel
    [OccType.Archer]: EquipmentsGemModel
    [OccType.Assassin]: EquipmentsGemModel
    [OccType.Assistant]: EquipmentsGemModel
    constructor(opts: any = {}) {
        this[OccType.Warrior] = new EquipmentsGemModel(opts[OccType.Warrior])
        this[OccType.MainTank] = new EquipmentsGemModel(opts[OccType.MainTank])
        this[OccType.Wizard] = new EquipmentsGemModel(opts[OccType.Wizard])
        this[OccType.Archer] = new EquipmentsGemModel(opts[OccType.Archer])
        this[OccType.Assassin] = new EquipmentsGemModel(opts[OccType.Assassin])
        this[OccType.Assistant] = new EquipmentsGemModel(opts[OccType.Assistant])
    }
}

export class TeamEquipmentModel {
    equipmentList: TeamEquipmentListModel
    packageList: TeamPackageListModel
    packageActive:TeamPackageActiveModel
    equipmentsStrList?: EquipmentsStrListModel
    equipmentsGemList?: EquipmentsGemListModel
    constructor(opts: any = {}) {
        this.equipmentList = new TeamEquipmentListModel(opts.equipmentList)
        this.packageList = new TeamPackageListModel(opts.packageList)
        this.packageActive = new TeamPackageActiveModel(opts.packageActive)
        // this.equipmentsStrList = new EquipmentsStrListModel(opts.equipmentsStrList)
        // this.equipmentsGemList = new EquipmentsGemListModel(opts.equipmentsGemList)
    }
}